@extends('layouts.app')
@include('crowd.sidebar')
@section('content')
    <div class="content">
        <a class="btn btn-info btn-sm" href="{{ redirect()->back()->getTargetUrl() }}"> 返回 </a>
        <br />
        <br />
        {!! form($form) !!}
    </div>
@endsection
@push("stylesheets")
@endpush
@push("scripts")
<script>
    // $('.content').find('form').addClass('form-inline')
    $('.content').find('form').find('label').attr('style', 'width:100px;text-align:center')
    $('.form-group').attr('style', 'margin:10px 0px;display: inline-flex;')

    $('[for="name"]').parent().after('<br>');
    
    $('[for="cover"]').next('div').attr('style', 'display:inline')
    $('[for="cover"]').parent().find('br').remove();
    $('[for="cover"]').parent().find('p').attr('style', 'margin-left:10px;display:inline');
    $('[for="cover"]').parent().after('<br>');

    $('[for="video"]').next('div').attr('style', 'display:inline')
    $('[for="video"]').parent().find('br').remove();
    $('[for="video"]').parent().find('p').attr('style', 'margin-left:10px;display:inline');
    $('[for="video"]').parent().after('<br>');

    $('[for="display_price"]').parent().after('<br>');
    $('[for="price"]').parent().after('<br>');
    $('[for="description"]').parent().after('<br>');
</script>
    <script>
        tinymce.init({
            selector: '#editor, #editor1',
            plugins: "textcolor colorpicker uploadimage autoresize",
            menubar: false,
            toolbar: "uploadimage undo redo | fontsizeselect bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify",
            images_upload_url: '/admin/upload_image?_token=' + $('meta[name="csrf-token"]').attr('content'),
            images_upload_credentials: true,
            image_dimensions: false,
            image_caption: false,
            image_description: false,
            language: 'zh_CN',
            language_url : '/tinymce/langs/zh_CN.js',
            autoresize_min_height: 350,
            autoresize_max_height: 800,
            content_style: 'img {width: 100%; height: auto; vertical-align: middle;}',
            init_instance_callback: function (editor) {
                editor.on('change', function (e) {
                    editor.save();
                });
            }
        });
    </script>
@endpush
